package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Semestre implements Serializable {

	private static final long serialVersionUID = 130067061347142662L;
	
	private int numSemestre;
	private String libelle;
	private Collection<UE> listeUE;
	private Collection<Periode> listePeriodes;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Semestre() {}
	
	public Semestre(int numSemestre, String libelle) {
		super();
		this.numSemestre = numSemestre;
		this.libelle = libelle;
		this.listePeriodes = null;
		this.listeUE = null;
	}

	public Collection<UE> getListeUE() {
		return listeUE;
	}

	public void setListeUE(Collection<UE> listeUE) {
		this.listeUE = listeUE;
	}

	public Collection<Periode> getListePeriodes() {
		return listePeriodes;
	}

	public void setListePeriodes(Collection<Periode> listePeriodes) {
		this.listePeriodes = listePeriodes;
	}

	public int getNumSemestre() {
		return numSemestre;
	}
	
	public void setNumSemestre(int numSemestre) {
		this.numSemestre = numSemestre;
	}
	
	public String getLibelle() {
		return libelle;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
